﻿@{
}
<section class="container-fluid" style="background-color: white;">
    <div class="data-wrap case">
        <div class="data-tool clearfix">
            <div class="pull-left form-inline ">
            </div>
            <div class="pull-right">
                <form class="form-inline" id="formSearch">
                    <div class="input-group input-group-sm wd200 f_l">
                        <label class="input-group-addon m5_l wd100">名称：</label>
                        <input class="form-control wd100" name="name" type="text" autocomplete="off">
                    </div>
                    <button type="button" class="btn btn-default btn-sm active f_l" id="btnSearch"><span class="glyphicon glyphicon-search"></span> 搜索</button>
                </form>
            </div>
        </div>
        <div class="paging"></div>
    </div>
</section>
@section footerScript{
    <script type="text/javascript">
        var parent = artDialog.open.origin;
        function SelectFilter() {
            parent.$("table.privileges>tbody>tr").each(function (d) {
                var id = $(this).find("input[name='Id']").val();
                var btn = $("#btn_" + id);
                $(btn).addClass("disabled");
                $(btn).text("已选")
            });
        }

        function Select(obj) {
            var hc = $(obj).hasClass("disabled");
            if (!hc) {

                $(obj).addClass("disabled");

                var model = {
                    Type: $(obj).data("type"),
                    Name: $(obj).data("name"),
                    Value: $(obj).data("value")
                };

                parent.insertRow(model);

                $(obj).text("已选");

                Topro.UI.CloseDialog();
            }
        }

        $(function () {
            Topro.UI.DataAutoHeight();
            doSearch();
            $("#btnSearch").click(function () {
                doSearch();
            });
        });

        function Tip_success(word) {
            Topro.UI.Tip_success(word);
        }

        function doSearch() {
            Topro.UI.Pager(".paging", { pageSize : 10,ajax: { url: '@Url.Action("SelectQuery", "Home",new { Type = ViewBag.Type })' } });
        }
    </script>
}
